package com.itheima.Map;

import java.util.HashMap;
import java.util.Map;

public class MapMethodTest {
    public static void main(String[] args) {
        Map<String,String>map=new HashMap<>();
        map.put("郭靖","黄蓉");
        map.put("杨过","小龙女");
        map.put("张无忌","周芷若");
        System.out.println("添加三组元素"+map);
        map.put("张无忌","赵敏");
        System.out.println("张无忌对应的值改为赵敏"+map);
        map.remove("杨过");
        System.out.println("删除键杨过"+map);
        boolean zwj = map.containsKey("张无忌");
        System.out.println("判断集合中是否包含键张无忌"+zwj);

        boolean yzp = map.containsKey("尹志平");
        System.out.println("判断集合中是否包含键尹志平"+yzp);

        boolean Vmj = map.containsValue("灭绝师太");
        System.out.println(Vmj);

        System.out.println(map.isEmpty());

        map.clear();

        System.out.println(map.isEmpty());

    }
}
